<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title></title>
    <th:block th:include="statics/common/page/header"></th:block>
</head>
<body>
<div id="orgEmployee" v-cloak>
	<div v-show="showList">
        <Row class="search-panel-space">
            <div class="search-group">
                <i-col span="5">
                	<label class="search-label-20">公司名称:</label>
                    <i-input v-model="q.companyName" @on-enter="query" placeholder="名称" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                	<label class="search-label-20">姓名:</label>
                    <i-input v-model="q.name" @on-enter="query" placeholder="姓名" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                	<label class="search-label-20">手机号:</label>
                    <i-input v-model="q.phone" @on-enter="query" placeholder="手机号" class="search-item-width-75"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                <i-button type="info" @click="add"> <!-- th:if="${@shiroAuthService.hasPermission('orgemployee:save')}"> -->
                	<i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <i-button type="warning" @click="update"> <!-- th:if="${@shiroAuthService.hasPermission('orgemployee:update')}"> -->
                	<i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <i-button type="error" @click="del"> <!-- th:if="${@shiroAuthService.hasPermission('orgemployee:delete')}"> -->
                	<i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
            </div>
        </Row>
	    <table id="orgEmployeeGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title" style="height: 35px;">{{title}}
            <i-button type="warning" @click="reload" style="margin-right: 8px;float: right;"/>
            返回</i-button></p>
		<i-form ref="formValidate" :model="orgEmployee" :rules="ruleValidate" :label-width="80">
            <Form-item label="所属公司" prop="companyId" style="width: 450px;">
                <i-input v-model="orgEmployee.companyName" placeholder="所属公司"
                	icon="eye" readonly="readonly" @on-click="deptTree"/>
            </Form-item>
            <Form-item label="所属部门" prop="departId" style="width: 450px;">
                <i-select v-model="orgEmployee.departId" @on-change="changeDepart" filterable>
                    <i-option v-for="depart in departmentList" :value="depart.id" :key="depart.id">{{depart.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="职位" prop="positionId" style="width: 450px;">
                <i-select v-model="orgEmployee.positionId" filterable>
                    <i-option v-for="position in positionList" v-if="position.isShow" :value="position.id" :key="position.id">{{position.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="姓名" prop="name" style="width: 450px;">
                <i-input v-model="orgEmployee.name" placeholder="姓名"/>
            </Form-item>
            <Form-item label="手机号" prop="phone" style="width: 450px;">
                <i-input v-model="orgEmployee.phone" placeholder="手机号"/>
            </Form-item>
            <Form-item label="生日" prop="birthday" style="width: 450px;">
                <Date-picker id="birthday" placeholder="选择日期"  type="date" v-model="orgEmployee.birthday"></Date-picker>
            </Form-item>
            <Form-item label="备注" prop="description" style="width: 450px;">
                <i-input v-model="orgEmployee.description" placeholder="备注" type="textarea" :autosize="{minRows:3,maxRows:7}"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<div id="orgCompanyLayer" style="display: none;padding:10px;">
    <ul id="orgCompanyTree" class="ztree"></ul>
</div>

<script th:src="@{../statics/js/org/employee.js}"></script>
</body>
</html>